import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:todo/models/models.dart';
import 'package:todo/widgets/todo_page.dart';

class MessagePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return TodoPage(
      child: Container(
        child: Center(
          child: Column(
            children: <Widget>[
              RaisedButton(
                child: const Text("切换主题"),
                onPressed: () => Provider.of<NTheme>(context).toggle(),
              ),
              RaisedButton(
                child: const Text("刷新数据"),
                onPressed: () => Provider.of<NTodoList>(context).reload(),
              )
            ],
          ),
        ),
      ),
    );
  }
}
